﻿@{
    ViewBag.Title = "三爱随访";

    var titles2 = "个人信息,康复知识,随访填报,检查单上传,历史数据,健康大事记,短信查询".Split(',');//短信随访
    var titles = "个人信息档,康复知识栏,随访问答汇,检查上传窗,随访历史誌,健康备忘录,手机短信箱".Split(',');//短信随访单
    var titleChars = "档,知,答, ,志,记,信,,".Split(',');
    var titleActs = "Me,KB,MySF,MemoEditJcd,Hist,MemoList,MyQizCommList,QizSmsSessionList".Split(',');
}

<style>
    body
    {
        background-color: #333333;
    }

    .ui-content
    {
    }

    .tile-container
    {
        padding: 0;
        /* margin: 0.4em; */
        margin-left: 1.2em;
        margin-right: 1.2em;
    }

    .tile
    {
        width: 50%;
        /* height: 200px; */
        margin: .5em;
        margin-left: -.5em;
        margin-right: -.5em;
        text-align: center;
        overflow: hidden;
    }

        .tile .charbg
        {
            font-size: 138px;
            z-index: 0;
            opacity: 0.2;
            color: white;
            padding-left: 30px;
            padding-top: 30px;
            font-family: SimSun;
            overflow: hidden;
            float: left;
        }

        .tile .texttitle
        {
            position: absolute;
            text-align: center;
            z-index: 1;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        .tile a
        {
            display: block;
            width: 100%;
            height: 100%;
            color: white !important;
            font-weight: normal;
            font-size: 1.5em;
            font-family: 微软雅黑;
            text-decoration: none;
        }

            .tile a:hover, .tile a:active
            {
                color: yellow !important;
            }


    .texttitle .message
    {
        color: white !important;
        font-size: 2em;
        font-family: 微软雅黑;
        display: block;
        height: 2.5em;
        line-height: 2.5em;
        position: relative;
        top: -2em;
        text-align: right;
        padding-right: 0.8em;
    }

    .tile a:hover, .tile a:active
    {
        color: yellow !important;
    }

    .tile.c0
    {
        float: left;
    }

    .tile.c1
    {
        float: right;
    }

    .color-schema0, .cs0
    {
        background-color: #d11141;
    }

    .color-schema1, .cs1
    {
        background-color: #00b159;
    }

    .color-schema2, .cs2
    {
        background-color: #00aedb;
    }

    .color-schema3, .cs3
    {
        background-color: #f37735;
    }

    .color-schema4, .cs4
    {
        background-color: #ff1d77;
    }

    .color-schema5, .cs5
    {
        background-color: #8ec127;
    }

    .color-schema6, .cs6
    {
        background-color: #a200ff;
    }

    .color-schema6, .cs7
    {
        background-color: #42c1bd;
    }
</style>
@section scripts{
    <script type="text/javascript">
        function resizeTiles() {
            var w = $(".tile").first().innerWidth() + "px";
            $(".tile").css("height", w);

            $(".tile div").css("width", w);
            $(".tile div").css("height", w);

            $(".tile").css("line-height", w);
        }

        function getQizSmsUnReadCount() {
            var smsLink = $('a[href*="QizSmsSessionList"]');
            if (smsLink == null) return;
            var smsBlock = smsLink.parent();
            $.get('@Url.Action("GetQizSmsUnReadCount")', { _p: Math.random() }, function (data) {
                try {
                    var count = parseInt(data);
                    if (!isNaN(count)) {
                        if (smsBlock.find('.message').length > 0) {
                            unReadText = smsBlock.find('.message');
                            unReadText.text(count);
                        } else {
                            unReadText = $('<span class="message">' + count + '</span>');
                            smsBlock.append(unReadText);
                        }
                        if (count == 0) {
                            unReadText.hide();
                        }
                    }
                } catch (e) {
                }
            }, "html");
        };

        $(function () {
            $("#tile-container").resize(resizeTiles());
            //debugger;
            resizeTiles();
            getQizSmsUnReadCount();
        });
    </script>
}

<div class="tile-container">
    @for (int i = 0; i < titles.Length; i++)
    {
        var tiletitle = titles[i];
        <div class="tile c@(i % 2) cs@(i % 8)">
            <div class="charbg">
                @titleChars[i]
            </div>
            <div class="texttitle">
                <a href="@Url.Action(titleActs[i])">
                    @tiletitle
                </a>
            </div>
        </div>
    }

</div>
